//
// Created by 张易生 on 2022/1/12.
//

#ifndef ZYSPLAYER_ZYSFRAMEQUEUE_H
#define ZYSPLAYER_ZYSFRAMEQUEUE_H

#include "queue"
#include "pthread.h"
#include "AndroidLog.h"
#include "ZYSPlayStatus.h"

extern "C"{
#include "libavcodec/avcodec.h"
};

class ZYSFrameQueue {
public:
    std::queue<AVFrame *> queueFrame;
    pthread_mutex_t mutexFrame;
    pthread_cond_t condFrame;
    ZYSPlayStatus *playStatus = nullptr;

public:

    ZYSFrameQueue(ZYSPlayStatus *playStatus);
    ~ZYSFrameQueue();

    int putAVFrame(AVFrame *frame);
    int getAVFrame(AVFrame *frame);

    int getQueueSize();

};


#endif //ZYSPLAYER_ZYSFRAMEQUEUE_H
